﻿using System.Collections.Generic;
using System.ComponentModel;
using Rodunu.Movies.Services.Models.Netflix.Attributes;

namespace Rodunu.Movies.Services.Models.Netflix
{
    public class CatalogList
    {
        private List<CatalogTitle> _titles = new List<CatalogTitle>();

        [XPath("/catalog_titles/number_of_results/text()")]
        public int NumberOfResults { get; set; }

        [XPath("/catalog_titles/start_index/text()")]
        public int StartIndex { get; set; }

        [XPath("/catalog_titles/results_per_page/text()")]
        public int ResultsPerPage { get; set; }

        [XPath("/catalog_titles/catalog_title")]
        public List<CatalogTitle> Titles
        {
            get { return _titles; }
            set
            {
                _titles = value;
            }
        }

        public CatalogTitle this[int index]
        {
            get { return _titles[index]; }
        }

    }
}